package com.lagou.service.impl;

import com.lagou.service.DubboService;
import org.apache.dubbo.config.annotation.Service;

@Service
public class DubboServiceImpl implements DubboService {
    @Override
    public String methodA() {
        System.out.println("这是A方法...");
        MySleep();
        return "method A 成功.";
    }

    @Override
    public String methodB() {
        System.out.println("这是B方法...");
        MySleep();
        return "method B 成功.";
    }

    @Override
    public String methodC() {
        System.out.println("这是C方法...");
        MySleep();
        return "method C 成功.";
    }

    private void MySleep(){
        int timeout = (int)(Math.random() * 100);
        try {
            Thread.sleep(timeout);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
